package com.example.tools.common.login;

import com.example.tools.common.base.BaseEntity;
import com.example.tools.common.base.Gender;
import com.example.tools.common.base.UserState;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Administrator on 2019-09-15.
 */
@Entity
@Table(name = "stUser")
public class User extends BaseEntity {

    /**
     * 登录名称
     */
    @Column(length = 20)
    private String loginName;

    //用户名
    @Column(length = 50)
    private String userName;

    private Gender gender;
    //密码  密码不随实体update
    @Column(length = 50, updatable = false)
    @JsonIgnore
    private String password;

    /**
     * 是否管理员
     */
    private Boolean manager;

    /**
     * 状态，0正常，1冻结，2删除
     */
    private UserState state;

    /**
     * 联系电话
     */
    @Column(length = 15)
    private String phone;

    /**
     * 手机号码
     */
    @Column(length = 15)
    private String mobilePhone;

    @Column(length = 50)
    private String email;

    public User() {
    }

    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Boolean getManager() {
        return manager;
    }

    public void setManager(Boolean manager) {
        this.manager = manager;
    }

    public UserState getState() {
        return state;
    }

    public void setState(UserState state) {
        this.state = state;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
